/// <reference path="../../typings/index.d.ts" />
'use strict';
const express = require('express');
const router = express.Router();

module.exports = {
    auth: (req, res, next) => {
        const { username, userpass } = req.session;
        console.log(username, userpass);
        if (username == '' || username == undefined) {
            return res.json({
                err: new Error('session过期!'),
                msg: 'session过期，即将跳转至登录界面！！',
                data: null,
            })
        }
        next();
    }
};